package com.ly.dingtalk.pojo.callback.eventbody.oa;

import java.lang.reflect.Type;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;

/**
 * @author wangzhen
 */
public class OaEventResultDeserializer implements JsonDeserializer<OaEventResult> {
    @Override
    public OaEventResult deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        final String asString = json.getAsString();
        return OaEventResult.of(asString).orElse(null);
    }
}
